package com.castle.fortress.admin.exchange.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.castle.fortress.admin.exchange.entity.ExchangeVoucherEntity;
import com.castle.fortress.admin.exchange.dto.ExchangeVoucherDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.HashMap;
import java.util.Map;
import java.util.List;

/**
 * 兑换券 服务类
 *
 * @author whc
 * @since 2022-12-06
 */
public interface ExchangeVoucherService extends IService<ExchangeVoucherEntity> {

    /**
     * 分页展示兑换券列表
     *
     * @param page
     * @param exchangeVoucherDto
     * @return
     */
    IPage<ExchangeVoucherDto> pageExchangeVoucher(Page<ExchangeVoucherDto> page, ExchangeVoucherDto exchangeVoucherDto);

    /**
     * 分页展示兑换券扩展列表
     *
     * @param page
     * @param exchangeVoucherDto
     * @return
     */
    IPage<ExchangeVoucherDto> pageExchangeVoucherExtends(Page<ExchangeVoucherDto> page, ExchangeVoucherDto exchangeVoucherDto);

    /**
     * 兑换券扩展详情
     *
     * @param id 兑换券id
     * @return
     */
    ExchangeVoucherDto getByIdExtends(Long id);

    /**
     * 展示兑换券列表
     *
     * @param exchangeVoucherDto
     * @return
     */
    List<ExchangeVoucherDto> listExchangeVoucher(ExchangeVoucherDto exchangeVoucherDto);

    /**
     * 生成兑换券
     *
     * @param params
     */
    void generate(HashMap<String, String> params);

    /**
     * 生成兑换券编号
     *
     * @param element  组成元素
     * @param length   长度
     * @param isPrefix 是否开启前缀
     * @param prefix   前缀
     * @return
     */
    String getNo(String element, String length, String isPrefix, String prefix);

    /**
     * 下载二维码压缩包查询接口
     * @param exchangeVoucherDto
     * @return
     */
    List<ExchangeVoucherDto> downloadList(ExchangeVoucherDto exchangeVoucherDto);
}
